package com.example.computer_exam_training_sys.service;

import com.example.computer_exam_training_sys.entity.UserFavoritesInfo;

import java.util.List;
import java.util.Map;

public interface UserFavoritesService {

    List<UserFavoritesInfo> findAll();
    List<UserFavoritesInfo> findByUserId(Integer userId);
    UserFavoritesInfo findById(Integer id);
    UserFavoritesInfo findByUserAndQuestion(Integer userId, Integer questionId);
    int insert(UserFavoritesInfo favorite);
    int deleteById(Integer id);
    int deleteByUserAndQuestion(Integer userId, Integer questionId);
    // 新增方法：判断用户是否已收藏某题
    boolean existsByUserAndQuestion(Integer userId, Integer questionId);
    List<Map<String, Object>> findFavoritesWithDetail(Integer userId, Integer courseId, Integer pointId, String startTime, String endTime);
    List<Map<String, Object>> findFavoritesByIds(List<Integer> ids);
}
